<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>汽车4S店客服管理系统总订单页面</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="汽车,4S店,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" type="text/css" href="CSS/reMainPage.css"> 
	<link rel="stylesheet" type="text/css" href="CSS/allOrder.css"> 
  </head>
  
  <body>
    <% 
    	request.setCharacterEncoding("utf-8");
    	response.setHeader("Content-type", "text/html;charset=UTF-8");
    	response.setCharacterEncoding("UTF-8"); 
    %>
    <%
    	String name=(String)session.getAttribute("name"); 
    	String ident=(String)session.getAttribute("ident");
    	if(name==null||name==""||ident==null||ident=="")
    	{
    		response.sendRedirect("index.jsp");
    	}
     %>
    <div class="allbody">
    	<div class="headbody">
    		<div class="maintitle">汽车4S店客服管理系统</div>
    	</div>
    	<div class="mylist" id="mylist">
    		<ul class="prolist">
    			<li><a href="userList">车型信息</a></li>
    			<li><a href="user">个人信息</a></li>
    			<li>
    				<c:if test="${ident!='职工'&&ident!='管理员'}">
    					车型保养维修
    				</c:if>
    			</li>
    			<li>
    				<c:if test="${ident=='用户'}">
    					客服
    				</c:if>
    			</li>
    			<li>
    				<c:if test="${ident!='职工'&&ident!='管理员'}">
    					个人订单
    				</c:if>
    			</li>
    			<c:if test="${ident=='职工'||ident=='管理员'}">
    				<li><a href="pendTask">待处理任务</a></li>
    				<li>增加车型</li>
    				<li>车型试驾订购</li>
    				<li>车型维修保养</li>
    				<li>订单处理</li>
    				<li>总订单</li>
    			</c:if>
    			<c:if test="${ident=='管理员'}">
    				<li>职工信息</li>
    				<li>用户信息</li>
    			</c:if>
    		</ul>
    	</div>
    	<div class="carmain">
    		<div class="username">
    			欢迎登陆,<%=name%><%=ident%>
    		</div>
    		<div class="closelogin">
    			<a href="javascript:void(0);">退出登陆</a>
    		</div>
    		<div class="showMyMess">
    			<div class="onmess">
    				<div class="findOrder">
    					<span>请输入搜索的用户名称：</span>
    					<input type="text">
    					<select>
    						<option>全部</option>
    						<option>无需付款</option>
    						<option>未付款</option>
    						<option>已付款</option>
    					</select>
    					<div class="selectTime">
	    					<select class="year">
	    						<option value="" selected></option>
	    						<c:forEach var="year" begin="1945" end="2099">
	    						<option value="${year}">${year}</option>
	    						</c:forEach>
	    					</select>年
	    					<select class="month">
	    						<option value="" selected></option>
	    						<c:forEach var="month" begin="1" end="12">
	    						<option value="${month}">${month}</option>
	    						</c:forEach>
	    					</select>月
	    					<select class="day">
	    						<option value="" selected></option>
	    						<c:forEach var="day" begin="1" end="31">
	    						<option value="${day}">${day}</option>
	    						</c:forEach>
	    					</select>日
    					</div>
    					<input type="button" value="查询">
    				</div>
    				<div class="order">
    					<c:if test="${sessionScope.myOrder!=null}">
    					<p><B>所有试驾购车订单：</B></p>
    					<table>
    						<tr>
    							<td>订单编号</td><td>订单类型</td><td>车型名称</td>
    							<td>车型颜色</td><td>订单日期</td><td>用户名</td>
    							<td>负责人</td><td>订单价格</td><td>订单状态</td>
    						</tr>
    						<c:forEach items="${sessionScope.myOrder}" var="mo">
    						<tr>
    							<td>${mo.ORDER_ID}</td>
    							<td>${mo.ORDER_TYPE}</td>
    							<td>${mo.CAR_ID}</td>
    							<td>${mo.ORDER_COLOR}</td>
    							<td>${mo.ORDER_DATE}</td>
    							<td>${mo.USER_ID}</td>
    							<td>${mo.ORDER_FZR}</td>
    							<td>${mo.ORDER_MONEY}</td>
    							<td>
    								<c:if test="${mo.ORDER_FZR!=sessionScope.name||mo.ORDER_RES=='已付款'||mo.ORDER_RES=='无需付款'}">
    									${mo.ORDER_RES}
    								</c:if>
    								<c:if test="${mo.ORDER_FZR==sessionScope.name&&mo.ORDER_RES=='未付款'}">
    									<select class="pay_money">
    										<option value="未付款" <c:if test="${mo.ORDER_RES=='未付款'}">selected</c:if>>未付款</option>
    										<option value="已付款" <c:if test="${mo.ORDER_RES=='已付款'}">selected</c:if>>已付款</option>
    									</select>
    								</c:if>
    							</td>
    						</tr>
    						</c:forEach>
    					</table>
    					</c:if>
    					<c:if test="${sessionScope.myOrder==null}">
    						<p class="noDingdan">暂无与试驾或购车相关的订单,请新增订单后查看~</p>
    					</c:if>
    				</div>
    				<div class="repair">
    					<c:if test="${sessionScope.myRepair!=null}">
    					<p><B>所有保养维修订单：</B></p>
    					<table>
    						<tr>
    							<td>订单编号</td><td>订单类型</td><td>车型名称</td>
    							<td>问题部位</td><td>订单日期</td><td>用户名</td>
    							<td>负责人</td><td>订单价格</td><td>订单状态</td>
    						</tr>
    						<c:forEach items="${sessionScope.myRepair}" var="mr">
    						<tr>
    							<td>${mr.REP_ID}</td>
    							<td>${mr.REP_TYPE}</td>
    							<td>${mr.REP_CARNAME}</td>
    							<td>${mr.REP_PROBLEM}</td>
    							<td>${mr.REP_DATE}</td>
    							<td>${mr.USER_ID}</td>
    							<td>${mr.REP_FZR}</td>
    							<td>${mr.REP_MONEY}</td>
    							<td>
    								<c:if test="${mr.REP_FZR!=sessionScope.name||mr.REP_STATE=='已付款'}">
    									${mr.REP_STATE}
    								</c:if>
    								<c:if test="${mr.REP_FZR==sessionScope.name&&mr.REP_STATE=='未付款'}">
    									<select class="weixiu_money">
    										<option value="未付款" <c:if test="${mo.ORDER_RES=='未付款'}">selected</c:if>>未付款</option>
    										<option value="已付款" <c:if test="${mo.ORDER_RES=='已付款'}">selected</c:if>>已付款</option>
    									</select>
    								</c:if>
    							</td>
    						</tr>
    						</c:forEach>
    					</table>
    					</c:if>
    					<c:if test="${sessionScope.myRepair==null}">
    						<p class="noDingdan">暂无与维修或保养相关订单,请新增订单后查看~</p>
    					</c:if>
    				</div>
    			</div>
    		</div>
    	</div>
    </div>
    
    <script type="text/javascript"  src="JS/jquery-3.1.0.js"></script>
	<script type="text/javascript"  src="JS/reMainPage.js"></script>
	<script type="text/javascript"  src="JS/allOrder.js"></script>
  </body>
</html>
